<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>发送消息</title>
<link href="<%=request.getContextPath()%>/css/reset.css" rel="stylesheet" type="text/css"/>
<link href="<%=request.getContextPath()%>/css/style.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript">
	function selectContacts(){
		var arr = showModalDialog("<%=request.getContextPath()%>/PersionFile.do?method=selectUser", "", "dialogWidth:550pt;dialogHeight:400pt;help:0;status:0");
		if(arr != null){
			var sendMessageReceiverId = document.form1.sendMessageReceiverId.value;
			var perFileName = document.form1.perFileName.value;
			if(sendMessageReceiverId == null)
				sendMessageReceiverId = "";
			if(perFileName == null)
				perFileName = "";
			for(var i = 0; i < arr.length; i++){
				var arrT = arr[i];
				if(sendMessageReceiverId.indexOf(arrT[0]) < 0){
					sendMessageReceiverId += arrT[0] + ",";
					perFileName += arrT[1] + ";";
				}
			}
			document.form1.sendMessageReceiverId.value = sendMessageReceiverId;
			document.form1.perFileName.value = perFileName;
	  	}
    }
    
    function clearContacts(){
            document.form1.sendMessageReceiverId.value = "";
			document.form1.perFileName.value = "";
    }
    
  	function check(){
		var frm = document.form1;
		if(frm.perFileName.value == ""){
			alert("请选择收件人！");
			frm.perFileName.focus();
			return false;
		}
		if(frm.sendMessageTitle.value == ""){
			alert("请填写消息标题！");
			frm.sendMessageTitle.focus();
			return false;
		}
		if(frm.sendMessageContent.value == ""){
			alert("请填写消息内容！");
			frm.sendMessageContent.focus();
			return false;
		}
	}
</script>
</head>

<body>
<jsp:include page="/admin/userMessageMiddle.jsp?tag=send"/>
<form action="<%=request.getContextPath()%>/MessageInfo.do?method=send" name="form1" method="post" onsubmit="return check()">
<table width="90%">
  <tr>
    <td width="100" align="right" class="bg_blue">收件人：</td>
    <td>     
    <input name="perFileName" type="text" size="90" value="" onClick="javascript:selectContacts()" readonly value="${rmInfo.receiverPersionFile.perFileName}"/> 
    <br/><input type="button" name="Submit" value="添加发送人" onclick="javascript:selectContacts()"/> <input type="button" name="Submit" value="清空发送列表" onclick="javascript:clearContacts()"/>
    <input name="sendMessageReceiverId" type="hidden" value="${rmInfo.receiverPersionFile.perFileId}">
    </td>
  </tr>
  <tr>
    <td align="right" class="bg_blue">主题：</td>
    <td><input name="sendMessageTitle" type="text" size="90" maxlength="100" value="${rmInfo.receiveMessageTitle}"/></td>
  </tr>
  <tr>
    <td align="right" class="bg_blue">内容：</td>
    <td><textarea name="sendMessageContent" cols="70" rows="10" type="_moz">${rmInfo.receiveMessageContent}</textarea></td>
  </tr>
  <tr>
    <td colspan="2" align="center" class="nohover"><input class="buttonsend" type="submit" name="" value="发送"/></td>
  </tr>
  </form>
</table>

</body>
</html>
